<%-- 
    Document   : logout
    Created on : Jan 16, 2012, 9:41:33 PM
    Author     : Korn Marcelo & Ruchlis Oleg
--%>
<%
    // making sure there a user logged-in in this session
    String username = (String)session.getAttribute("username");
    if(username != null){
        // removing the user from the list
        String users = (String)application.getAttribute("users");
        users = users.replace(username + "\r\n", "");
        application.setAttribute("users", users);
        // updating the session attribute that the user logged out.
        session.setAttribute("username", null);
    }
%>
<jsp:forward page="index.jsp"/>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Logout Page</title>
    </head>
    <body>
    </body>
</html>
